﻿@model RefundControllerModel.Detail
<div>
    <div class="ui-box  ui-box-alpha">
        <div class="ui-box-head">
            <div class="ui-box-head-border">
                <div class="ui-box-head-title">
                    退款管理</div>
                <span class="ui-box-head-text">退款申请</span> <a href="#" class="ui-box-head-more">去购物</a>
            </div>
        </div>
        <div class="ui-box-container">
            <div class="ui-box-content">
                <div class="ui-step-3">
                    <ul class="unstyled ui-step-bar">
                        <li class="ui-step-start-cur">
                            <dl>
                                <dt><strong><span class="ui-step-no">1</span><em class="ui-step-name"> 买家 申请退款 </em>
                                </strong></dt>
                                <dd class="ui-step-status">
                                </dd>
                            </dl>
                        </li>
                        <li class="">
                            <dl>
                                <dt><span class="ui-step-no">2</span><em class="ui-step-name"> 商家 处理退款申请 </em></dt>
                                <dd class="ui-step-status">
                                </dd>
                            </dl>
                        </li>
                        <li class="ui-step-end">
                            <dl>
                                <dt><span class="ui-step-no">3</span><em class="ui-step-name">退款成功</em></dt>
                                <dd class="ui-step-status">
                                </dd>
                            </dl>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="ui-box-container-noborder">
            <div class="row-fluid">
                <div class="span3">
                    <div class="refund-box">
                        <div class="ui-box-content">
                            <strong>退款申请</strong>
                            <ul class="unstyled">
                                <li>退款类型：@Model.Refund.Category</li>
                                <li>退款金额：@Model.Refund.Return.ToString("N")元</li>
                                <li>退款原因：@Model.Refund.ReasonId</li>
                                <li>退款编号：@Model.Refund.Id</li>
                                <li>申请时间：@Model.Refund.CreatedOn.ToString("yyyy-MM-dd HH:mm:ss")</li>
                                <li>退款说明：@Model.Refund.Desc</li>
                            </ul>
                            <div class="media">
                                <a class="pull-left" href="" target="_blank">
                                    <img data-src="holder.js/64x64" class="media-object" alt="64x64" style="width: 64px;
                                        height: 64px;" src="">
                                </a>
                                <div class="media-body">
                                    <p class="media-heading">
                                        @(Model.OrderItem.Title)
                                    </p>
                                    <p>
                                        @foreach (var o in Model.OrderItem.GetProps().OrderBy(o => o.Length))
                                        {
                                            @(o)<br />
                                        }
                                    </p>
                                </div>
                            </div>
                            <ul class="unstyled">
                                <li class="refund-info-auction-price">单&nbsp;&nbsp;&nbsp;&nbsp;价：<span class="desc"><span
                                    class="ui-price ui-price-original">@Model.OrderItem.Price.ToString("N")</span>元&nbsp;&nbsp;X&nbsp;&nbsp;
                                    @(Model.OrderItem.Quantity)(数量)</span></li>
                                <li>优&nbsp;&nbsp;&nbsp;&nbsp;惠：@Model.OrderItem.Discount.ToString("N")元</li>
                                <li>小&nbsp;&nbsp;&nbsp;&nbsp;计：<strong class="ui-price">@((Model.OrderItem.Total).ToString("N"))</strong>元</li>
                            </ul>
                        </div>
                    </div>
                    <div class="refund-box">
                        <div class="ui-box-content">
                            <strong>订单信息</strong>
                            <ul class="unstyled">
                                <li>订单编号： <a target="_blank" href="/order/detail/@(Model.OrderItem.Order.Id)">@(Model.OrderItem.Order.Id)</a>
                                </li>
                                <li>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：<span class="desc">
                                    @if (Model.OrderItem.Order.Postage != 0)
                                    {
                                        @: <span class="ui-price ui-price-original">@Model.OrderItem.Order.Postage.ToString("N")</span>元
                                                                                    }
                                    else
                                    {
                                        <span>免运费</span>
                                    }
                                </span></li>
                                <li>订单优惠：<span class="desc">
                                    @if (Model.OrderItem.Order.Discount != 0)
                                    {
                                        @: <span class="ui-price ui-price-original">@Model.OrderItem.Order.Discount.ToString("N")</span>元
                                                  }
                                    else
                                    {
                                        <span>无优惠</span>
                                    }
                                </span></li>
                                <li>总&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;计：<strong class="ui-price">@(Model.OrderItem.Order.Total)</strong>
                                    元</li>
                                <li>成交时间：@Model.OrderItem.Order.CreatedOn.ToString("yyyy-MM-dd HH:mm:ss")</li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="span9">
                    <div style="border-left: 1px solid #E5E5E5;">
                        @using (Html.BeginForm())
                        {
                            if (Model.OrderItem.Status == OrderStatus.WaitSellerSend)
                            {
                            <div class="ui-box-content">
                                <p>
                                    <strong>请处理退款申请</strong>
                                </p>
                                <p>
                                    确认退款前，请您确认该订单的货物是否尚未发出，避免不必要的损失。</p>
                            </div>
                            <div>
                                <button class="ui-btn ui-btn-alpha offset4" type="button" onclick="submitForm(this.form);">
                                    同意退款申请</button>
                            </div>
                            }
                            if (Model.OrderItem.Status == OrderStatus.WaitSellerSend)
                            {

                            }
                        }</div>
                </div>
            </div>
        </div>
    </div>
</div>
<div>
    <div class="questions">
        <h4>
            常见问题看这里</h4>
        <h5>
            1、申请退款我要怎么操作？</h5>
        <p>
            答：在交易还未成功前，您可以再次根据您当前的实际情况申请退款，<a href="http://service.taobao.com/support/knowledge-1115556.htm?spm=1.83613.133578.1&amp;"
                target="_blank">具体详情点此了解</a>。</p>
        <h5>
            2、最多可退款金额怎么计算出来的？</h5>
        <p>
            答：根据交易的形式以及优惠情况，计算略有不同，<a href="http://service.taobao.com/support/knowledge-1114525.htm?spm=1.83613.133578.2&amp;"
                target="_blank">具体详情点此了解</a>。</p>
        <h5>
            3、淘宝交易退款成功后，在哪里查询退回的钱款？</h5>
        <p>
            答：退款成功后，交易款项将立即退回到您的支付宝账户，您可以登录支付宝账户查询余额或收支记录。<a href="http://service.taobao.com/support/help-3313.htm?spm=1.83613.133578.3&amp;"
                target="_blank">具体详情点此了解</a>。</p>
        <h5>
            4、卖家拒绝退款给我怎么办？</h5>
        <p>
            答：如果卖家还未发货，卖家在处理退款申请过程中无法操作拒绝退款，只能操作同意退款或确认发货，并且，卖家发货的行为需要得到买家的同意。</p>
        <p class="more-help">
            <a href="http://service.taobao.com/support/9803.htm?spm=1.83613.130830.3" target="_blank">
                更多帮助</a></p>
    </div>
</div>
@section css{
    <style type="text/css">
        .refund-box { }
        .media { margin-top: 5px; }
        .form-actions { margin-bottom: 0; }
        .questions { background-color: #FFFFFF; margin-top: 10px; padding: 12px 16px; color: #808080; border: 1px solid #E6E6E6; margin-bottom: 10px; }
    </style>
}
@section js{
    <script type="text/javascript">
        function submitForm(form) {
            var action = form.action;
            var param = $(form).serialize();
            $.postJSON(action, param, function (result) {
                if (result.Status == false) {
                    alert(result.Message);
                }
                else {
                    window.location = '/refund/detail/' + result.Data + "?action=1";
                    var msg = "您已成功申请退款，等待卖家处理退款申请。";
                    //申请已提交，请等待卖家处理。卖家必须在01天23时56分48秒内处理。您也可以主动联系卖家，要求尽快处理
                }
            });

        }
    </script>
}
